package org.huatek.anders.controller;

import com.alibaba.dubbo.config.annotation.Reference;
import org.huatek.anders.service.ApiCreditSenderService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

/**
 * @author anders
 * @since 2018/11/15 20:51
 */
@RestController
public class ApiCreditSenderController {
    @Reference
    ApiCreditSenderService apiCreditSenderService;


    @GetMapping("/auth/bank")
    public void  authBankPart(){
        Map<String,Object> head = new HashMap<>(1);
        head.put("type", "cash");
        apiCreditSenderService.creditBank(head, "银行授信(部分匹配)");
    }
    @GetMapping("/auth/bank/full")
    public void  authBankFull(){
        Map<String,Object> head = new HashMap<>(2);
        head.put("type", "cash");
        head.put("aging", "fast");
        apiCreditSenderService.creditBank(head, "银行授信(全部匹配)");
    }
    @GetMapping("/auth/finance")
    public void  authFinance(){
        Map<String,Object> head = new HashMap<>(1);
        head.put("type", "cash");
        apiCreditSenderService.creditFinance(head, "金融公司授信(部分匹配)");
    }
    @GetMapping("/auth/finance/full")
    public void  authFinanceFull(){
        Map<String,Object> head = new HashMap<>(2);
        head.put("type", "cash");
        head.put("aging", "fast");
        apiCreditSenderService.creditFinance(head, "金融公司授信(全部匹配)");
    }
}
